package cn.laike.modules.dev.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import cn.laike.common.utils.PageUtils;
import cn.laike.common.utils.Query;

import cn.laike.modules.dev.dao.CityDao;
import cn.laike.modules.dev.entity.CityEntity;
import cn.laike.modules.dev.entity.ConfigEntity;
import cn.laike.modules.dev.service.CityService;


@Service("cityService")
public class CityServiceImpl extends ServiceImpl<CityDao, CityEntity> implements CityService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<CityEntity> page = this.selectPage(
                new Query<CityEntity>(params).getPage(),
                new EntityWrapper<CityEntity>()
                .eq("del_flag", "0")
                .orderBy("sort", false)
        );

        return new PageUtils(page);
    }

	@Override
	public CityEntity getCityByName(String name) {
		return this.selectOne(new EntityWrapper<CityEntity>()
				.like("name", name));
	}
    
	@Override
	public List<CityEntity> queryList() {
		return this.selectList(new EntityWrapper<CityEntity>()
				.eq("is_show", "0")
                .eq("del_flag", "0")
                .orderBy("sort", false));
	}

	@Override
	public List<CityEntity> queryHotelCityList(Long uid) {
		return this.baseMapper.queryHotelCityList(uid);
	}



}
